﻿using FutureApp.Authorization;
using FutureApp.Authorization.Dto;
using System;
using System.Threading.Tasks;
using System.Web.Mvc;

namespace FutureApp.Web.Controllers
{
    public class PermissionsController : FutureAppControllerBase
    {
        public IPermissionDefinitionAppService PermissionDefinitionAppService { get; set; }


        public async Task<ActionResult> List()
        {
            var input = new GetAllPermissionDefinitionInput();
            var list = await this.PermissionDefinitionAppService.GetAll(input);
            return this.View(list);
        }

        public ActionResult Add()
        {
            return this.View();
        }

        public async Task<ActionResult> Edit(Guid id)
        {
            var input = new GetPermissionDefinitionInput { Id = id };
            var entity = await this.PermissionDefinitionAppService.Get(input);
            return this.View(entity);
        }
    }
}
